30d59d2e27fbd562faebf0df73073343ab2abeff,engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/migration/MigrationBoundaryEventsParameterizedTest.java,MigrationBoundaryEventsParameterizedTest,testMigrateBoundaryEventToParallelSubProcess,#,605
Before Change
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(sourceProcess);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(targetProcess);
MigrationPlan migrationPlan = rule.getRuntimeService()
.createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId())
.mapActivities("subProcess1", "subProcess1")
.mapActivities(BOUNDARY_ID, NEW_BOUNDARY_ID)
.mapActivities("subProcess2", "subProcess2")
.mapActivities("userTask1", "userTask1")
.mapActivities("userTask2", "userTask2")
.build();
// when
testHelper.createProcessInstanceAndMigrate(migrationPlan);
// then
configuration.assertMigration(testHelper, BOUNDARY_ID, NEW_BOUNDARY_ID);
// and it is possible to successfully complete the migrated instance
testHelper.completeTask("userTask1");
testHelper.completeTask("userTask2");
testHelper.assertProcessEnded(testHelper.snapshotBeforeMigration.getProcessInstanceId());
}
After Change
public void testMigrateBoundaryEventToParallelSubProcess() {
// given
BpmnEventTrigger bpmnEventTrigger = configuration.addBoundaryEvent(ProcessModels.PARALLEL_SUBPROCESS_PROCESS, "subProcess1");
BpmnModelInstance sourceProcess = bpmnEventTrigger.getProcessModel();
BpmnModelInstance targetProcess = modify(sourceProcess).changeElementId(BOUNDARY_ID, NEW_BOUNDARY_ID);
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(sourceProcess);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(targetProcess);
Map<String, String> activities = new HashMap<String, String>();
activities.put("subProcess1", "subProcess1");
activities.put(BOUNDARY_ID, NEW_BOUNDARY_ID);
activities.put("subProcess2", "subProcess2");
activities.put(USER_TASK_1_ID, USER_TASK_1_ID);
activities.put(USER_TASK_2_ID, USER_TASK_2_ID);
MigrationPlan migrationPlan = configuration.createMigrationPlanBuilder(rule, sourceProcessDefinition.getId(),
targetProcessDefinition.getId(), activities).build();
// when
testHelper.createProcessInstanceAndMigrate(migrationPlan);
// then
configuration.assertEventSubscriptionMigration(testHelper, BOUNDARY_ID, NEW_BOUNDARY_ID);
// and it is possible to successfully complete the migrated instance
testHelper.completeTask(USER_TASK_1_ID);
testHelper.completeTask(USER_TASK_2_ID);
testHelper.assertProcessEnded(testHelper.snapshotBeforeMigration.getProcessInstanceId());
}